import Vue from 'vue'
import Router from 'vue-router'
  /*@toLogin
   *后台主体
   *admin => 主体页
   */
import admin from '../view/admin/admin'
  /*@Login
   *登录
   *Login => 登录页
   */
import Login from '../view/login/login'
//router test
import test from '../view/test/test'
  /*@approvingSystem router
   * 审批系统
   * allApproving => 所有审批
   * myApproving  => 我的审批
   * userOrderMsg => 用户信息
   */
import apporvingSystem from '../view/approvingSystem/apporvingSystem'
import allApproving from '../view/approvingSystem/allApproving/allApproving'
import userOrderMsg from '../view/approvingSystem/allApproving/userOrderMsg/userOrderMsg'
import myApproving from '../view/approvingSystem/myApproving/myApproving'
  /*@financialSystem router
   * 财务系统
   * orderList     => 订单列表
   * paymentOrder  => 还款订单
   * loanOrders    => 放款订单
   * checkTheOrder => 复核订单
   */
import orderList from '../view/financialSystem/orderList/orderList'
import paymentOrder from '../view/financialSystem/paymentOrder/paymentOrder'
import loanOrders from '../view/financialSystem/loanOrders/loanOrders'
import checkTheOrder from '../view/financialSystem/checkTheOrder/checkTheOrder'
/*@messageCenter
 * 消息中心
 */
import messageCenter from '../view/messageCenter/messageCenter'
Vue.use(Router)
const adminRouterList = [
  // {
  //   path: '/',
  //   redirect:'/admin/apporvingSystem',
  //   component: apporvingSystem
  // },
  {
    path:'messageCenter',
    name:'apporvingSystem',
    component:messageCenter
  },
  {
    path: 'apporvingSystem',
    name: 'apporvingSystem',
    component: apporvingSystem,
  },
  {
    path: '/userOrderMsg',
    name: 'userOrderMsg',
    component: userOrderMsg
  },
  {
    path: '/test',
    name: 'test',
    component: test
  },
  {
    path: 'allApproving',
    name: 'allApproving',
    component: allApproving
  },
  {
    path: 'myApproving',
    name: 'myApproving',
    component: myApproving
  },
  {
    path: '/orderList',
    name: 'orderList',
    component: orderList
  },
  {
    path: '/paymentOrder',
    name: 'paymentOrder',
    component: paymentOrder
  },
  {
    path: '/loanOrders',
    name: 'loanOrders',
    component: loanOrders
  },
  {
    path: '/checkTheOrder',
    name: 'checkTheOrder',
    component: checkTheOrder
  }
]
const adminList = [
  {
    name:'审批系统',
    isShow:false,
    children:[{
      path: '/allApproving',
      name: '所有审批',
    },
    {
      path: '/myApproving',
      name: '我的审批',
    },]},
  {
    name: '财务系统',
    isShow:false,
    children:[
      {
      path: '/orderList',
      name: '订单列表',
      },
      {
        path: '/paymentOrder',
        name: '付款订单',
      },
      {
        path: '/loanOrders',
        name: '催款订单',
      },
      {
        path: '/checkTheOrder',
        name: '复核订单',
      }
      ]
  }
]
export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login,
      meta:{
        auth: true
      }
    },
    {
      path: '/admin',
      name: 'admin',
      component: admin,
      props:{adminList:adminList},
      children:adminRouterList
    },

  ],
  beforeEach(){
    alert(1);
  }
})


